<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<style type="text/css">
		.redClass {
			color: red;
			border-style: solid;
			border-width: 5px;
		}

		.greenClass {
			color: green;
			border-style: solid;
			border-width: 1px;
		}
	</style>

	<body>
		<div id="app">
			<div :class="{'redClass' : error,'greenClass' :!error}" style="width: 6.25rem; height: 6.25rem;">

			</div>
			<button type="button" @click="change">切换</button>
		</div>

		<script src="./js/vue.js" charset="utf-8"></script>
		<script>
			var vm = new Vue({
				el: "#app",
				data: {
					error: true
				},
				methods: {
					change: function() {
						this.error = !this.error;
					}
				}

			})
		</script>
	</body>
</html>
